home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_07 / plauger / issync.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-03  |  266 b   |  17 lines

  1. // issync -- istream::sync()
  2. #include <istream>
  3.  
  4. int istream::sync()
  5.     {    // synchronize buffer
  6.     if (!good())
  7.         return (EOF);
  8.     else if (rdbuf()->pubsync() == EOF)
  9.         {    // note sync failure
  10.         setstate(badbit);
  11.         return (EOF);
  12.         }
  13.     else
  14.         return (0);
  15.     }
  16.  
  17.